<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <input type="text" placeholder="请输入您要判断的年份" class="inp1" />
    <button>判断</button>
  </body>
</html>
<script>
  var ipt1 = document.querySelector(".inp1");
  var btn = document.querySelector("button");
  btn.onclick = function () {
    var year = ipt1.value * 1;
    if (year % 400 == 0 || (year % 4 == 0 && year % 100 !== 0)) {
      console.log(s);
      alert(year + "是闰年");
    } else {
      alert(year + "不是闰年");
    }
  };
</script>
